﻿//-------------------------------------------------------------------------------------
// All Rights Reserved , Copyright (C) 2011 , Hairihan TECH, Ltd.
//-------------------------------------------------------------------------------------

using System.Data;
using System.ServiceModel;

namespace DotNet.IService
{
    using DotNet.Model;
    using DotNet.Utilities;

    /// <summary>
    /// IFolderService
    ///
    /// 修改纪录
    ///
    ///		2008.05.05 版本：1.0 JiRiGaLa 添加权限。
    ///
    /// 版本：1.0
    ///
    /// <author>
    ///		<name>JiRiGaLa</name>
    ///		<date>2008.05.05</date>
    /// </author>
    /// </summary>
    [ServiceContract]
    public interface IFolderService
    {
        [OperationContract]
        BaseFolderEntity GetEntity(BaseUserInfo userInfo, string id);

        [OperationContract]
        DataTable GetDTByParent(BaseUserInfo userInfo, string id);

        [OperationContract]
        string Add(BaseUserInfo userInfo, BaseFolderEntity folderEntity, out string statusCode, out string statusMessage);

        [OperationContract]
        string AddByFolderName(BaseUserInfo userInfo, string parentId, string folderName, bool enabled, out string statusCode, out string statusMessage);

        [OperationContract]
        int Update(BaseUserInfo userInfo, BaseFolderEntity folderEntity, out string statusCode, out string statusMessage);

        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        [OperationContract]
        DataTable GetDT(BaseUserInfo userInfo);

        /// <summary>
        /// 重命名
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <param name="newName">新名称</param>
        /// <param name="enabled">有效</param>
        /// <param name="statusCode">状态码</param>
        /// <param name="statusMessage">状态信息</param>
        /// <returns>影响行数</returns>
        [OperationContract]
        int Rename(BaseUserInfo userInfo, string id, string newName, bool enabled, out string statusCode, out string statusMessage);

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="search">查询</param>
        /// <returns>数据表</returns>
        [OperationContract]
        DataTable Search(BaseUserInfo userInfo, string searchValue);

        [OperationContract]
        int Delete(BaseUserInfo userInfo, string id);

        [OperationContract]
        int BatchDelete(BaseUserInfo userInfo, string[] ids);

        [OperationContract]
        int MoveTo(BaseUserInfo userInfo, string folderId, string parentId);

        [OperationContract]
        int BatchMoveTo(BaseUserInfo userInfo, string[] folderIds, string parentId);

        [OperationContract]
        int BatchSave(BaseUserInfo userInfo, DataTable dataTable);
    }
}